charger28 2.2.1
Loading...
Searching...
No Matches
main.c File Reference

Charger 28 Click example. More...

#include "board.h"
#include "log.h"
#include "charger28.h"

Macros

#define MIKROBUS_POSITION_CHARGER28   MIKROBUS_1

Functions

void application_init (void)
void application_task (void)
int main (void)

Detailed Description

Charger 28 Click example.

Description

This example demonstrates the use of the Charger 28 Click board by monitoring various parameters of the charging system, such as input voltage (VBUS), battery voltage (VBAT), system voltage (VSYS), charging current (IBAT), and chip temperature (TDIE). Additionally, it reads and interprets the charger status and fault registers to provide detailed status and error feedback during operation.

The demo application is composed of two sections:

Application Init

Initializes the driver and performs the default configuration of the Charger 28 Click by disabling charging, resetting registers, disabling the TS pin, configuring the ADC, and re-enabling charging.

Application Task

Periodically retrieves and logs charging parameters such as input voltage, battery voltage, system voltage, charging current, and temperature. The application also reads the status and fault registers to determine the current charging state and logs the information for debugging or monitoring purposes.

Note
The application is designed to continuously monitor the charging system, providing real-time feedback on its operation. The detailed charge status parsing includes states such as "Not Charging", "Trickle Charge", "Fast Charge", and "Charge Done", among others, to help track the charging process.
Author
Stefan Filipovic

Macro Definition Documentation

◆ MIKROBUS_POSITION_CHARGER28

#define MIKROBUS_POSITION_CHARGER28   MIKROBUS_1

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )